import Vue from 'vue';

export default new Vue({
  data () {
    return {
      person: {
        name: 'zhangsan',
        age: 18,
      },
    };
  },
  created () {
    this.$on('改名字', (newName) => {
      this.person.name = newName;
    });
    this.$on('改年龄', (newAge) => {
      this.person.age = newAge;
    });
  },
});
// instance.person.name
